Method WithNamespaces(params (string Prefix, string Uri)[])

Assembly: redb.Route.dll

Returns the same expression with prefixes bound to namespace URIs, so a path can address a
namespace-qualified document.

public XPathExpression WithNamespaces(params (string Prefix, string Uri)[] namespaces)

Remarks

XPath("/s:Envelope/s:Body").WithNamespaces(("s", "http://schemas.xmlsoap.org/soap/envelope/")).
The expression has always accepted an , but only through
its constructor — a route written in the DSL had no way to reach it, which made every
namespaced document unqueryable from a route without dropping out of the DSL.


The prefixes are the expression's own: they need not match the ones in the document, only
the URIs must. Camel keeps namespace sets in a registry and refers to them by name
(namespacesRef) because its XML DSL cannot write a map inline; in C# the map is
ordinary code, so a shared set is an ordinary variable.